<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8" />
    <title>注册 - 购车咨询</title>
    <link rel="stylesheet" th:href="@{/css/style.css}" />
</head>
<body>
<div class="container">
    <h1>注册</h1>
    <form th:action="@{/register}" th:object="${registerForm}" method="post">
        <div class="field"><label>用户名</label><input type="text" th:field="*{username}" /></div>
        <div class="field"><label>密码</label><input type="password" th:field="*{password}" /></div>
        <div class="field"><label>姓名</label><input type="text" th:field="*{name}" /></div>
        <div class="field"><label>手机号</label><input type="text" th:field="*{phone}" /></div>
        <div class="field"><label>购车预算下限</label><input type="number" th:field="*{budgetMin}" /></div>
        <div class="field"><label>购车预算上限</label><input type="number" th:field="*{budgetMax}" /></div>
        <div class="field"><label>偏好车型</label>
            <select th:field="*{preferredBodyType}">
                <option value="SUV">SUV</option>
                <option value="轿车">轿车</option>
                <option value="MPV">MPV</option>
            </select>
        </div>
        <div><button type="submit" class="btn">注册</button></div>
    </form>
    <p th:if="${error}" th:text="${error}" style="color:#b00020"></p>
    <p>已有账号？<a href="/login">登录</a></p>
    <p class="hint">我们保护您的隐私，密码采用加密存储。</p>
</div>
</body>
</html>